<?php

namespace app\mini\ui\table;

use app\mini\enum\PosEnum;
use app\mini\enum\TypeEnum;
use suframe\thinkAdmin\ui\table\TableInterface;

/**
 * 小程序菜单表格
 */
class MiniNavTable extends TableInterface
{
    public function header()
    {
        return array(
            'id' => ['label' => 'ID', 'sort' => true, 'fixed' => 'left', 'width' => 80],
            'name' =>
                array(
                    'label' => '菜单名称',
                ),
            'icon' =>
                array(
                    'label' => '菜单图标',
                    'type' => 'image',
                ),
            'selected_icon' =>
                array(
                    'label' => '菜单选择图标',
                    'type' => 'image',
                ),
            'path' =>
                array(
                    'label' => '菜单路径',
                ),
            'type' =>
                array(
                    'label' => '菜单类型',
                    'field' => 'type',
                    'filter' => TypeEnum::toZhArray()
                ),
            'pos' =>
                array(
                    'label' => '菜单类型',
                    'field' => 'pos',
                    'filter' => PosEnum::toZhArray()
                ),
        );
    }

    public function filters()
    {
        return [
            'name' => ['label' => '菜单名称', 'type' => 'text'],
        ];
    }
}